// 高峰小时最小发车间隔
$.ajax({
  type: "get",
  async: true, //异步执行
  url: base_url + "/minDptrIntvl",
  dataType: "json", //返回数据形式为json
  success: function (data) {
    if (data.code == 1000) {
      if (data.data !== null) {
        DptrIntvlData = data.data.datas;
        if (Object.keys(data.data).length !== 0) {
          $(".departureInterval_average").text(data.data.max);
          if (DptrIntvlData.length !== 0) {
            lnNm = DptrIntvlData.map((v) => v.lnNm);
            lnHrMinDptrIntvl = DptrIntvlData.map((v) => v.lnHrMinDptrIntvl);
            maximumHourlyEchart();
          } else {
            $("#departureInterval_chart").html(
              "<div class='noData'>今日暂无数据</div>"
            );
          }
        } else {
          $("#departureInterval_chart").html(
            "<div class='noData'>今日暂无数据</div>"
          );
        }
      } else {
        $("#departureInterval_chart").html(
          "<div class='noData'>今日暂无数据</div>"
        );
      }
    } else {
      alert(data.message);
    }
    // fn();
  },
  error: function (errorMsg) {
    console.log("请求数据失败");
  },
});

// 进度指数
progressIndexJEchart();
function progressIndexJEchart() {
  let progressIndexJE = document.getElementsByClassName("progressIndexJEchart");
  for (var i = 0; i < progressIndexJE.length; i++) {
    let myChart = echarts.init(progressIndexJE[i]);
    var chartData = [0.82, 1.0, 0.5, 6.72];
    var chartData2 = [0.82, 1.01, 0.5375, 7.7];
    var chartData3 = [1.01, 1.01, 1.08, 1.15];
    option = {
      tooltip: {
        trigger: "axis",
        axisPointer: {
          type: "shadow",
          label: {
            show: true,
          },
        },
      },
      grid: {
        left: "10%",
        top: "10%",
        right: "10%",
        bottom: "20%",
      },
      legend: {
        data: ["计划量", "完成量", "完成率"],
        top: "92%",
        textStyle: {
          color: "#fff",
          fontSize: 12,
        },
      },
      xAxis: {
        data: ["10号线二期", "14号线", "15号线", "18号线"],
        axisLine: {
          show: true, //隐藏X轴轴线
          lineStyle: {
            color: "#A1A1A1",
            width: 1,
          },
        },
        axisTick: {
          show: true, //隐藏X轴刻度
          alignWithLabel: true,
        },
        axisLabel: {
          show: true,
          textStyle: {
            color: "#fff", //X轴文字颜色
            fontSize: 12,
          },
          margin: 10,
          interval: 0,
          rotate: 0,
        },
      },
      yAxis: [
        {
          type: "value",
          name: "",
          nameTextStyle: {
            color: "#A1A1A1",
            fontSize: 12,
          },
          splitLine: {
            show: true,
            lineStyle: {
              width: 2,
              color: "#A1A1A1",
            },
          },
          axisTick: {
            show: false,
          },
          axisLine: {
            show: false,
          },
          axisLabel: {
            show: true,
            textStyle: {
              color: "#fff",
              fontSize: 12,
            },
            formatter: function (value, index) {
              return value.toFixed(2);
            },
          },
        },
        {
          type: "value",
          name: "",
          nameTextStyle: {
            color: "#A1A1A1",
            fontSize: 12,
          },
          position: "right",
          splitLine: {
            show: false,
          },
          axisTick: {
            show: false,
          },
          axisLine: {
            show: false,
            lineStyle: {
              color: "#A1A1A1",
              width: 2,
            },
          },
          axisLabel: {
            show: true,
            formatter: function (value, index) {
              return value.toFixed(2);
            },
            textStyle: {
              color: "#fff",
              fontSize: 12,
            },
          },
        },
      ],
      series: [
        {
          name: "计划量",
          type: "bar",
          barWidth: 30,
          itemStyle: {
            normal: {
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                {
                  offset: 0,
                  color: "#5B9BD5",
                },
                {
                  offset: 1,
                  color: "#5B9BD5",
                },
              ]),
            },
          },
          data: chartData,
        },
        {
          name: "完成量",
          type: "bar",
          barWidth: 30,
          itemStyle: {
            normal: {
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                {
                  offset: 0,
                  color: "#ED7D31",
                },
                {
                  offset: 1,
                  color: "#ED7D31",
                },
              ]),
            },
          },
          data: chartData2,
        },
        {
          name: "完成率",
          type: "line",
          yAxisIndex: 1, //使用的 y 轴的 index，在单个图表实例中存在多个 y轴的时候有用
          showAllSymbol: true, //显示所有图形。
          symbol: "circle", //标记的图形为实心圆
          symbolSize: 6, //标记的大小
          itemStyle: {
            //折线拐点标志的样式
            color: "#26D9FF",
            borderColor: "#A1A1A1",
            width: 2,
            shadowColor: "#A1A1A1",
            shadowBlur: 2,
          },
          lineStyle: {
            color: "#A1A1A1",
            width: 2,
            shadowBlur: 2,
          },
          data: chartData3,
        },
      ],
    };
    myChart.setOption(option);
  }
}
//风险指数
riskIndexJEchart();
function riskIndexJEchart() {
  let riskIndexJE = document.getElementsByClassName("riskIndexJEchart");
  for (var i = 0; i < riskIndexJE.length; i++) {
    let myChart = echarts.init(riskIndexJE[i]);
    option = {
      tooltip: {
        position: "inside",
        formatter: "小于0.4为正常<br>大于0.4为预警",
        textStyle: {
          fontSize: 10,
        },
      },
      series: [
        {
          name: "刻度",
          type: "gauge",
          center: ["50%", "70%"],
          radius: "90%",
          min: 0, //最小刻度
          max: 0.8, //最大刻度
          splitNumber: 8, //刻度数量
          startAngle: 180,
          endAngle: 0,
          axisLine: {
            show: true,
            lineStyle: {
              width: 1,
              color: [[1, "rgba(0,0,0,0)"]],
            },
          }, //仪表盘轴线
          axisLabel: {
            show: true,
            color: "#0ab7ff",
            fontSize: 15,
            distance: -50,
            formatter: function (v) {
              return v + "";
            },
          }, //刻度标签。
          axisTick: {
            show: true,
            splitNumber: 5,
            lineStyle: {
              color: "#0ab7ff",
              width: 1,
            },
            length: -3,
          }, //刻度样式
          splitLine: {
            show: true,
            length: -5,
            lineStyle: {
              color: "#0ab7ff",
            },
          }, //分隔线样式
        },
        {
          type: "gauge",
          radius: "80%",
          center: ["50%", "70%"],
          splitNumber: 0, //刻度数量
          startAngle: 180,
          endAngle: 0,
          axisLine: {
            show: true,
            lineStyle: {
              width: 30,
              color: [
                [0.5, "#00a65a"],

                [0.75, "#f39c11"],
                [1, "#fa4e4b"],
              ],
            },
          },
          //分隔线样式。
          splitLine: {
            show: false,
          },
          axisLabel: {
            show: false,
          },
          axisTick: {
            show: false,
          },
          pointer: {
            show: true,
            length: "80%",
            width: "2%",
          },
          title: {
            show: true,
            offsetCenter: [0, "50%"], // x, y，单位px
            textStyle: {
              fontWeight: "bold",
              color: "#0ab7ff",
              fontSize: 20,
            },
          },
          //仪表盘详情，用于显示数据。
          detail: {
            show: true,
            offsetCenter: [0, "20%"],
            color: "#ffffff",
            formatter: "{value}",
            textStyle: {
              fontSize: 30,
            },
          },
          data: [
            {
              name: "风险指数",
              value: 0.01,
            },
          ],
        },
        {
          // 仅显示tooltip用
          type: "pie",
          radius: "90%",
          hoverAnimation: true,
          label: {
            normal: {
              show: false,
              position: "center",
            },
          },
          labelLine: {
            normal: {
              show: false,
            },
          },
          z: 3,
          zlevel: 0,
          itemStyle: {
            borderWidth: 0,
          },
          data: [
            {
              value: 50,
              name: "",
              label: {
                normal: {
                  show: false,
                },
              },
              itemStyle: {
                normal: {
                  color: "transparent",
                },
              },
            },
          ],
        },
      ],
    };

    myChart.setOption(option);
  }
}
//投资完成率
investmentCompletionEchart();
function investmentCompletionEchart() {
  let investmentCompletionE = document.getElementsByClassName(
    "investmentCompletionEchart"
  );
  for (var i = 0; i < investmentCompletionE.length; i++) {
    let myChart = echarts.init(investmentCompletionE[i]);
    //职称结构取数
    var getsjjg = ["总投资", "完成投资"];
    var getsjjgrs = [70, 30];
    var syjgdata = [];
    for (var i = 0; i < getsjjg.length; i++) {
      syjgdata.push({
        name: getsjjg[i],
        value: getsjjgrs[i],
      });
    }
    var rich = {
      name: {
        color: "#fff",
        fontSize: 14,
        // padding: [5, 5, 0, 5],
        fontWeight: "400",
        align: "left",
      },
      value: {
        color: "#fff",
        fontSize: 12,
        // padding: [10, 5, 0, 10],
        fontWeight: "500",
        align: "left",
      },
      percent: {
        color: "#FFF",
        align: "right",
        fontSize: 15,
        fontWeight: "500",
        //padding: [0, 5]
      },
      hr: {
        borderColor: "#DFDFDF",
        width: "100%",
        borderWidth: 1,
        height: 0,
      },
      cir: {
        fontSize: 26,
      },
    };
    //职称结构图表
    var colorList = ["#507AFF", "#51D9A2", "#FFC371", "#797AFF"];
    option = {
      series: [
        {
          itemStyle: {
            normal: {
              color: function (params) {
                return colorList[params.dataIndex];
              },
            },
          },
          type: "pie",
          radius: ["0%", "50%"],
          center: ["50%", "50%"],
          label: {
            normal: {
              position: "inner",
              formatter: (params) => {
                return "{percent|" + params.percent.toFixed(0) + "%}";
              },
              rich: rich,
            },
          },
          data: syjgdata,
        },
        {
          itemStyle: {
            normal: {
              color: function (params) {
                return colorList[params.dataIndex];
              },
            },
          },
          type: "pie",
          silent: true, //取消高亮
          radius: ["0%", "50%"],
          center: ["50%", "50%"],
          labelLine: {
            normal: {
              length: 30,
              length2: 0,
              lineStyle: {
                color: "transparent",
              },
            },
          },
          label: {
            normal: {
              formatter: (params) => {
                return (
                  "{name|" +
                  params.name +
                  "}\n{hr|}\n{value|" +
                  params.value +
                  "本}"
                );
              },
              rich: rich,
              padding: [2, 25, 0, 25],
            },
          },
          data: syjgdata,
          z: -1,
        },
        {
          itemStyle: {
            normal: {
              color: function (params) {
                return colorList[params.dataIndex];
              },
            },
          },
          type: "pie",
          silent: true, //取消高亮
          radius: ["0%", "50%"],
          center: ["50%", "50%"],
          labelLine: {
            normal: {
              length: 30,
              length2: 0,
              lineStyle: {
                color: "transparent",
              },
            },
          },
          label: {
            normal: {
              formatter: (params) => {
                return "\n{cir|●}\n";
              },
              rich: rich,
            },
          },
          data: syjgdata,
          z: -1,
        },
        {
          itemStyle: {
            normal: {
              color: "#F2F9F7",
            },
          },
          type: "pie",
          silent: true, //取消高亮
          radius: ["0%", "57%"],
          center: ["50%", "50%"],
          hoverAnimation: false, //取消动画效果
          data: syjgdata,
          label: {
            normal: {
              show: false,
              position: "inner",
              formatter: (params) => {
                return "{percent|" + params.percent.toFixed(0) + "%}";
              },
              rich: rich,
            },
          },
          z: -1,
        },
      ],
    };
    myChart.setOption(option);
  }
}
// 试运行完成率
commissioningCompletedEchart();
function commissioningCompletedEchart() {
  let commissioningCompletedE = document.getElementsByClassName(
    "commissioningCompletedEchart"
  );
  for (var i = 0; i < commissioningCompletedE.length; i++) {
    let myChart = echarts.init(commissioningCompletedE[i]);
    // 数据进度值
    var dataArr = 0;
    // if (data == undefined) {
    //   dataArr = 0;
    // }
    var option = {
      backgroundColor: "#333f54",
      title: {
        show: true,
        text: "试运行完成率",
        x: "50%",
        y: "59%",
        z: 8,
        textAlign: "center",
        textStyle: {
          color: "#f1f7fe",
          fontSize: 14,
          fontWeight: "normal",
        },
      },
      series: [
        {
          name: "内部（环形）进度条",
          type: "gauge",
          center: ["50%", "55%"],
          radius: "65%",
          splitNumber: 10,
          axisLine: {
            lineStyle: {
              color: [
                [dataArr / 100, "#458EFD"],
                [1, "#333f54"],
              ],
              width: 14,
            },
          },
          axisLabel: {
            show: false,
          },
          axisTick: {
            show: false,
          },
          splitLine: {
            show: false,
          },
          pointer: {
            show: false,
          },
        },
        {
          name: "外部刻度",
          type: "gauge",
          center: ["50%", "55%"],
          //  center: ['20%', '50%'],
          radius: "80%",
          min: 0, //最小刻度
          max: 100, //最大刻度
          splitNumber: 10, //刻度数量
          startAngle: 225,
          endAngle: -45,
          axisLine: {
            show: true,
            // 仪表盘刻度线
            lineStyle: {
              width: 2,
              color: [[1, "#333f54"]],
            },
          },
          //仪表盘文字
          axisLabel: {
            show: true,
            color: "#D6F1FF",
            distance: 25,
            formatter: function (v) {
              switch (v + "") {
                case "0":
                  return "0";
                case "10":
                  return "10";
                case "20":
                  return "20";
                case "30":
                  return "30";
                case "40":
                  return "40";
                case "50":
                  return "50";
                case "60":
                  return "60";
                case "70":
                  return "70";
                case "80":
                  return "80";
                case "90":
                  return "90";
                case "100":
                  return "100";
              }
            },
          }, //刻度标签。
          axisTick: {
            show: true,
            splitNumber: 7,
            lineStyle: {
              color: "#3082FE", //用颜色渐变函数不起作用
              width: 2,
            },
            length: -8,
          }, //刻度样式
          splitLine: {
            show: true,
            length: -20,
            lineStyle: {
              color: "#458EFD", //用颜色渐变函数不起作用
            },
          }, //分隔线样式
          detail: {
            show: false,
          },
          pointer: {
            show: false,
          },
        },
        /*内部*/
        {
          type: "pie",
          radius: ["0", "50%"],
          center: ["50%", "55%"],
          z: 8,
          hoverAnimation: false,
          data: [
            {
              name: "检查进度",
              value: dataArr,
              itemStyle: {
                normal: {
                  color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                    {
                      offset: 0,
                      color: "#3398ff",
                    },
                    {
                      offset: 1,
                      color: "#7db0fd",
                    },
                  ]),
                },
              },
              label: {
                normal: {
                  formatter: function (params) {
                    return params.value + "%";
                  },
                  color: "#FFFFFF",
                  fontSize: 30,
                  fontWeight: "bold",
                  position: "center",
                  show: true,
                },
              },
              labelLine: {
                show: false,
              },
            },
          ],
        },
        /*外一层*/
        {
          type: "pie",
          radius: "45%",
          startAngle: 220,
          endAngle: -40,
          hoverAnimation: false,
          center: ["50%", "55%"],
          avoidLabelOverlap: false,
          label: {
            show: false,
          },
          labelLine: {
            show: false,
          },
          data: [
            {
              value: 1,
              itemStyle: {
                normal: {
                  color: "#8DC4FD",
                },
              },
            },
          ],
        },
        //外二层圈
        {
          type: "pie",
          radius: "50%",
          center: ["50%", "55%"],
          avoidLabelOverlap: false,
          z: 0,
          hoverAnimation: false,
          label: {
            show: false,
          },
          labelLine: {
            show: false,
          },
          data: [
            {
              value: 1,
              itemStyle: {
                normal: {
                  color: "#e3edf8",
                },
              },
            },
          ],
        },
      ],
    };
    myChart.setOption(option);
  }
}
//线路长度
lineLengthEchart();
function lineLengthEchart() {
  let lineLengthE = document.getElementsByClassName("lineLengthEchart");
  for (var i = 0; i < lineLengthE.length; i++) {
    let myChart = echarts.init(lineLengthE[i]);
    var fontColor = "#fff";
    var data = [
      {
        name: "10号线二期",
        value: 9.5,
      },
      {
        name: "14号线",
        value: 39,
      },
      {
        name: "15号线",
        value: 42.3,
      },
      {
        name: "18号线一期",
        value: 36.8,
      },
    ];

    option = {
      color: ["#02cdff", "#5f45ff", "#854cff", "#f9e264"],
      title: {
        text: 127.6,
        subtext: "线路长度（km）",
        textStyle: {
          color: "#f2f2f2",
          fontSize: 30,
        },
        subtextStyle: {
          fontSize: 15,
          color: ["#ff9d19"],
        },
        x: "32%",
        y: "38%",
      },
      tooltip: {
        trigger: "item",
        formatter: "{b}<br/> {c}  ({d}%)",
      },
      legend: {
        orient: "vertical",
        right: 10,
        textStyle: {
          color: "#f2f2f2",
          fontSize: 12,
        },
        icon: "roundRect",
        data: data,
      },
      series: [
        // 主要展示层的
        {
          radius: ["50%", "65%"],
          center: ["45%", "50%"],
          type: "pie",
          label: {
            position: "inner",
            formatter: "{b}：{c}",
          },
          labelLine: {
            normal: {
              show: true,
              length: 5,
              length2: 5,
            },
            emphasis: {
              show: true,
            },
          },
          data: data,
          itemStyle: {
            emphasis: {
              shadowBlur: 10,
              shadowOffsetX: 0,
              shadowColor: "rgba(0, 0, 0, 0.5)",
            },
            normal: {
              label: {
                show: true,
                formatter: "{b}:\n{c} ({d}%)",
              },
              labelLine: { show: true },
            },
          },
        },
        // 边框的设置
        {
          radius: ["45%", "50%"],
          center: ["45%", "50%"],
          type: "pie",
          label: {
            normal: {
              show: false,
            },
            emphasis: {
              show: false,
            },
          },
          labelLine: {
            normal: {
              show: false,
            },
            emphasis: {
              show: false,
            },
          },
          animation: false,
          tooltip: {
            show: false,
          },
          data: [
            {
              value: 1,
              itemStyle: {
                color: "rgba(250,250,250,0.3)",
              },
            },
          ],
        },
        {
          name: "外边框",
          type: "pie",
          clockWise: false, //顺时加载
          hoverAnimation: false, //鼠标移入变大
          center: ["45%", "50%"],
          radius: ["70%", "70%"],
          label: {
            normal: {
              show: false,
            },
          },
          data: [
            {
              value: 9,
              name: "",
              itemStyle: {
                normal: {
                  borderWidth: 2,
                  borderColor: "#0b5263",
                },
              },
            },
          ],
        },
      ],
    };

    myChart.setOption(option);
  }
}
// 车站
stationEchart();
function stationEchart() {
  let stationE = document.getElementsByClassName("stationEchart");
  for (var i = 0; i < stationE.length; i++) {
    let myChart = echarts.init(stationE[i]);
    // let dashedPic =
    //   "";
    let color = ["#FF8700", "#ffc300", "#00e473", "#009DFF"];
    let chartData = [
      {
        name: "10号线二期",
        value: 6,
        unit: "座",
      },
      {
        name: "14号线",
        value: 31,
        unit: "座",
      },
      {
        name: "15号线",
        value: 30,
        unit: "座",
      },
      {
        name: "18号线一期",
        value: 26,
        unit: "座",
      },
    ];
    let arrName = [];
    let arrValue = [];
    let sum = 0;
    let pieSeries = [],
      lineYAxis = [];

    // 数据处理
    chartData.forEach((v, i) => {
      arrName.push(v.name);
      arrValue.push(v.value);
      sum = sum + v.value;
    });

    // 图表option整理
    chartData.forEach((v, i) => {
      pieSeries.push({
        name: "学历",
        type: "pie",
        clockWise: false,
        hoverAnimation: false,
        radius: [65 - i * 15 + "%", 57 - i * 15 + "%"],
        center: ["40%", "50%"],
        label: {
          show: false,
        },
        data: [
          {
            value: v.value,
            name: v.name,
          },
          {
            value: sum - v.value,
            name: "",
            itemStyle: {
              color: "rgba(0,0,0,0)",
            },
          },
        ],
      });
      pieSeries.push({
        name: "",
        type: "pie",
        silent: true,
        z: 1,
        clockWise: false, //顺时加载
        hoverAnimation: false, //鼠标移入变大
        radius: [65 - i * 15 + "%", 57 - i * 15 + "%"],
        center: ["40%", "50%"],
        label: {
          show: false,
        },
        data: [
          {
            value: 7.5,
            itemStyle: {
              color: "#E3F0FF",
            },
          },
          {
            value: 2.5,
            name: "",
            itemStyle: {
              color: "rgba(0,0,0,0)",
            },
          },
        ],
      });
      v.percent = ((v.value / sum) * 100).toFixed(1) + "%";
      lineYAxis.push({
        value: i,
        textStyle: {
          rich: {
            circle: {
              color: color[i],
              padding: [0, 5],
            },
          },
        },
      });
    });

    option = {
      color: color,
      grid: {
        top: "15%",
        bottom: "54%",
        left: "30%",
        containLabel: false,
      },
      yAxis: [
        {
          type: "category",
          inverse: true,
          axisLine: {
            show: false,
          },
          axisTick: {
            show: false,
          },
          axisLabel: {
            formatter: function (params) {
              let item = chartData[params];
              console.log(item);
              return (
                "{line|}{circle|●}{name|" +
                item.name +
                "}{value|" +
                item.value +
                "}{unit|座}"
              );
            },
            interval: 0,
            inside: true,
            textStyle: {
              color: "#fff",
              fontSize: 14,
              rich: {
                line: {
                  width: 70,
                  height: 10,
                  // backgroundColor: { image: dashedPic },
                },
                name: {
                  color: "#fff",
                  fontSize: 12,
                },
                bd: {
                  color: "#fff",
                  padding: [0, 5],
                  fontSize: 12,
                },
                percent: {
                  color: "#fff",
                  fontSize: 14,
                },
                value: {
                  color: "#fff",
                  fontSize: 12,
                  fontWeight: 500,
                  padding: [0, 0, 0, 20],
                },
                unit: {
                  fontSize: 12,
                },
              },
            },
            show: true,
          },
          data: lineYAxis,
        },
      ],
      xAxis: [
        {
          show: false,
        },
      ],
      series: pieSeries,
    };
    myChart.setOption(option);
  }
}
//盾构区间
shieldIntervalEchart();
function shieldIntervalEchart() {
  let shieldIntervalE = document.getElementsByClassName("shieldIntervalEchart");
  for (var i = 0; i < shieldIntervalE.length; i++) {
    let myChart = echarts.init(shieldIntervalE[i]);
    option = {
      title: {
        show: true,
        text: "单位:km",
        top: "0%",
        left: "5%",
        textStyle: {
          color: "#fff",
          fontSize: 12,
        },
      },
      tooltip: {
        trigger: "axis",
        axisPointer: {
          type: "line",
          lineStyle: {
            opacity: 0,
          },
        },
      },
      grid: {
        left: "5%",
        right: "5%",
        bottom: "5%",
        top: "10%",
        containLabel: true,
        z: 22,
      },
      xAxis: [
        {
          show: true,
          type: "category",
          gridIndex: 0,
          data: ["10号线二期", "14号线", "15号线", "18号线一期"],
          axisTick: {
            alignWithLabel: true,
          },
          axisLine: {
            lineStyle: {
              color: "#fff",
            },
          },
          axisLabel: {
            show: true,
            color: "#fff",
          },
        },
      ],
      yAxis: [
        {
          show: true,
          type: "value",
          name: "",
          nameTextStyle: {
            color: "rgb(170,170,170)",
          },
          max: 100,
          min: 0,
          gridIndex: 0,
          splitLine: {
            show: false,
          },
          axisTick: {
            show: false,
          },
          axisLine: {
            lineStyle: {
              color: "#fff",
            },
          },
          axisLabel: {
            color: "#fff",
            formatter: "{value}",
          },
        },
        {
          type: "value",
          gridIndex: 0,
          min: 0,
          max: 100,
          splitNumber: 12,
          splitLine: {
            show: false,
          },
          axisLine: {
            show: false,
          },
          axisTick: {
            show: false,
          },
          axisLabel: {
            show: false,
          },
          splitArea: {
            show: false,
          },
        },
      ],
      series: [
        {
          name: "盾构区间（km）",
          type: "bar",
          barWidth: "50px",
          xAxisIndex: 0,
          yAxisIndex: 0,
          itemStyle: {
            normal: {
              shadowColor: "rgba(0, 0, 0, .3)",
              shadowBlur: 5,
              shadowOffsetY: 10,
              shadowOffsetX: 0,
              label: {
                show: true, //开启显示
                position: "top", //在上方显示
                formatter: "{c}km",
                textStyle: {
                  //数值样式
                  color: "#fff",
                  fontSize: 12,
                },
              },
              color: function (params) {
                var colorList = [
                  new echarts.graphic.LinearGradient(1, 0, 0, 0, [
                    {
                      offset: 0,
                      color: "#7c930f",
                    },
                    {
                      offset: 0.5,
                      color: "#7c930f",
                    },
                    {
                      offset: 0.5,
                      color: "#60730a",
                    },
                    {
                      offset: 1,
                      color: "#60730a",
                    },
                  ]),
                  new echarts.graphic.LinearGradient(1, 0, 0, 0, [
                    {
                      offset: 0,
                      color: "#f9b234",
                    },
                    {
                      offset: 0.5,
                      color: "#f9b234",
                    },
                    {
                      offset: 0.5,
                      color: "#c08c27",
                    },
                    {
                      offset: 1,
                      color: "#c08c27",
                    },
                  ]),
                  new echarts.graphic.LinearGradient(1, 0, 0, 0, [
                    {
                      offset: 0,
                      color: "#154364",
                    },
                    {
                      offset: 0.5,
                      color: "#154364",
                    },
                    {
                      offset: 0.5,
                      color: "#11354f",
                    },
                    {
                      offset: 1,
                      color: "#11354f",
                    },
                  ]),
                  new echarts.graphic.LinearGradient(1, 0, 0, 0, [
                    {
                      offset: 0,
                      color: "#e54646",
                    },
                    {
                      offset: 0.5,
                      color: "#e54646",
                    },
                    {
                      offset: 0.5,
                      color: "#b03935",
                    },
                    {
                      offset: 1,
                      color: "#b03935",
                    },
                  ]),
                  new echarts.graphic.LinearGradient(1, 0, 0, 0, [
                    {
                      offset: 0,
                      color: "#97579d",
                    },
                    {
                      offset: 0.5,
                      color: "#97579d",
                    },
                    {
                      offset: 0.5,
                      color: "#874d88",
                    },
                    {
                      offset: 1,
                      color: "#874d88",
                    },
                  ]),
                  new echarts.graphic.LinearGradient(1, 0, 0, 0, [
                    {
                      offset: 0,
                      color: "#00b1c3",
                    },
                    {
                      offset: 0.5,
                      color: "#00b1c3",
                    },
                    {
                      offset: 0.5,
                      color: "#0098a5",
                    },
                    {
                      offset: 1,
                      color: "#0098a5",
                    },
                  ]),
                  new echarts.graphic.LinearGradient(1, 0, 0, 0, [
                    {
                      offset: 0,
                      color: "#e83c88",
                    },
                    {
                      offset: 0.5,
                      color: "#e83c88",
                    },
                    {
                      offset: 0.5,
                      color: "#96154e",
                    },
                    {
                      offset: 1,
                      color: "#96154e",
                    },
                  ]),
                ];
                return colorList[params.dataIndex];
              },
            },
            emphasis: {
              opacity: 1,
            },
          },
          data: ["6", "58", "72", "62"],
          zlevel: 11,
        },
      ],
    };
    myChart.setOption(option);
  }
}
//
//客流量(日累计)
passengerFlowDateEchart();
function passengerFlowDateEchart() {
  let passengerFlowDateE = document.getElementsByClassName(
    "passengerFlowDateEchart"
  );
  for (var i = 0; i < passengerFlowDateE.length; i++) {
    let myChart = echarts.init(passengerFlowDateE[i]);
    let color = [
      "#0090FF",
      "#36CE9E",
      "#FFC005",
      "#FF515A",
      "#8B5CFF",
      "#00CA69",
    ];
    let echartData = [
      {
        name: "1号线",
        value1: 116.1765,
        value2: 115.8067,
      },
      {
        name: "2号线",
        value1: 143.9775,
        value2: 144.0845,
      },
      {
        name: "3号线",
        value1: 50.5984,
        value2: 50.2362,
      },
      {
        name: "4号线",
        value1: 80.6902,
        value2: 80.7711,
      },
      {
        name: "5号线",
        value1: 19.3266,
        value2: 19.0968,
      },
      {
        name: "6号线",
        value1: 45.8453,
        value2: 45.8756,
      },
      {
        name: "7号线",
        value1: 79.9822,
        value2: 80.5519,
      },
      {
        name: "8号线",
        value1: 101.6922,
        value2: 102.758,
      },
      {
        name: "9号线",
        value1: 108.5301,
        value2: 108.051,
      },
      {
        name: "10号线",
        value1: 84.3222,
        value2: 85.132,
      },
      {
        name: "11号线",
        value1: 88.0143,
        value2: 87.2315,
      },
      {
        name: "12号线",
        value1: 70.2513,
        value2: 70.4143,
      },
      {
        name: "13号线",
        value1: 64.5567,
        value2: 64.489,
      },
      {
        name: "16号线",
        value1: 22.5925,
        value2: 22.1945,
      },
      {
        name: "17号线",
        value1: 17.6584,
        value2: 17.2867,
      },
    ];

    let xAxisData = echartData.map((v) => v.name);
    //  ["1", "2", "3", "4", "5", "6", "7", "8"]
    let yAxisData1 = echartData.map((v) => v.value1);
    // [100, 138, 350, 173, 180, 150, 180, 230]
    let yAxisData2 = echartData.map((v) => v.value2);
    // [233, 233, 200, 180, 199, 233, 210, 180]
    const hexToRgba = (hex, opacity) => {
      let rgbaColor = "";
      let reg = /^#[\da-f]{6}$/i;
      if (reg.test(hex)) {
        rgbaColor = `rgba(${parseInt("0x" + hex.slice(1, 3))},${parseInt(
          "0x" + hex.slice(3, 5)
        )},${parseInt("0x" + hex.slice(5, 7))},${opacity})`;
      }
      return rgbaColor;
    };

    option = {
      color: color,
      legend: {
        right: 10,
        top: 10,
        textStyle: {
          //图例文字的样式
          color: "#fff",
          // fontSize: 16,
        },
      },
      tooltip: {
        trigger: "axis",
        formatter: function (params) {
          let html = "";
          params.forEach((v) => {
            console.log(v);
            html += `<div style="color: #666;font-size: 14px;line-height: 24px">
                <span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${
                  color[v.componentIndex]
                };"></span>
                ${v.seriesName}.${v.name}
                <span style="color:${
                  color[v.componentIndex]
                };font-weight:700;font-size: 18px">${v.value}</span>
                万元`;
          });

          return html;
        },
        extraCssText:
          "background: #fff; border-radius: 0;box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);color: #333;",
        axisPointer: {
          type: "shadow",
          shadowStyle: {
            color: "#ffffff",
            shadowColor: "rgba(225,225,225,1)",
            shadowBlur: 5,
          },
        },
      },
      grid: {
        top: "15%",
        left: "12%",
        right: "5%",
        bottom: "15%",
      },
      xAxis: [
        {
          type: "category",
          boundaryGap: false,
          axisLabel: {
            formatter: "{value}",
            interval: 0,
            rotate: 40,
            textStyle: {
              color: "#fff",
            },
          },
          axisLine: {
            lineStyle: {
              color: "#D9D9D9",
            },
          },
          data: xAxisData,
        },
      ],
      yAxis: [
        {
          type: "value",
          name: "单位：万人",
          axisLabel: {
            textStyle: {
              color: "#fff",
            },
          },
          nameTextStyle: {
            color: "#fff",
            fontSize: 14,
            lineHeight: 20,
          },
          splitLine: {
            lineStyle: {
              type: "dashed",
              color: "#E9E9E9",
            },
          },
          axisLine: {
            show: false,
          },
          axisTick: {
            show: false,
          },
        },
      ],
      series: [
        {
          name: "昨日客流量",
          type: "line",
          smooth: true,
          // showSymbol: false,/
          symbolSize: 8,
          zlevel: 3,
          lineStyle: {
            normal: {
              color: color[0],
              shadowBlur: 3,
              shadowColor: hexToRgba(color[0], 0.5),
              shadowOffsetY: 8,
            },
          },
          areaStyle: {
            normal: {
              color: new echarts.graphic.LinearGradient(
                0,
                0,
                0,
                1,
                [
                  {
                    offset: 0,
                    color: hexToRgba(color[0], 0.3),
                  },
                  {
                    offset: 1,
                    color: hexToRgba(color[0], 0.1),
                  },
                ],
                false
              ),
              shadowColor: hexToRgba(color[0], 0.1),
              shadowBlur: 10,
            },
          },
          data: yAxisData1,
        },
        {
          name: "今日客流量",
          type: "line",
          smooth: true,
          // showSymbol: false,
          symbolSize: 8,
          zlevel: 3,
          lineStyle: {
            normal: {
              color: color[1],
              shadowBlur: 3,
              shadowColor: hexToRgba(color[1], 0.5),
              shadowOffsetY: 8,
            },
          },
          areaStyle: {
            normal: {
              color: new echarts.graphic.LinearGradient(
                0,
                0,
                0,
                1,
                [
                  {
                    offset: 0,
                    color: hexToRgba(color[1], 0.3),
                  },
                  {
                    offset: 1,
                    color: hexToRgba(color[1], 0.1),
                  },
                ],
                false
              ),
              shadowColor: hexToRgba(color[1], 0.1),
              shadowBlur: 10,
            },
          },
          data: yAxisData2,
        },
      ],
    };
    myChart.setOption(option);
  }
}
//高峰小时最小发车间隔
// maximumHourlyEchart();
function maximumHourlyEchart() {
  let maximumHourlyE = document.getElementsByClassName("maximumHourlyEchart");
  for (var i = 0; i < maximumHourlyE.length; i++) {
    let myChart = echarts.init(maximumHourlyE[i]);
    option = {
      // backgroundColor: "#031245",
      textStyle: {
        color: "#c0c3cd",
        fontSize: 14,
      },
      toolbox: {
        show: false,
        feature: {
          saveAsImage: {
            backgroundColor: "#031245",
          },
          restore: {},
        },
        iconStyle: {
          borderColor: "#c0c3cd",
        },
      },
      legend: {
        top: 10,
        itemWidth: 8,
        itemHeight: 8,
        icon: "circle",
        left: "center",
        padding: 0,
        textStyle: {
          color: "#c0c3cd",
          fontSize: 14,
          padding: [2, 0, 0, 0],
        },
      },
      color: [
        "#63caff",
        "#49beff",
        "#03387a",
        "#03387a",
        "#03387a",
        "#6c93ee",
        "#a9abff",
        "#f7a23f",
        "#27bae7",
        "#ff6d9d",
        "#cb79ff",
        "#f95b5a",
        "#ccaf27",
        "#38b99c",
        "#93d0ff",
        "#bd74e0",
        "#fd77da",
        "#dea700",
      ],
      grid: {
        containLabel: true,
        left: 20,
        right: 20,
        bottom: 10,
        top: 25,
      },
      xAxis: {
        nameTextStyle: {
          color: "#c0c3cd",
          padding: [0, 0, -10, 0],
          fontSize: 12,
        },
        axisLabel: {
          color: "#c0c3cd",
          fontSize: 12,
          interval: 0,
          rotate: 40,
        },
        axisTick: {
          lineStyle: {
            color: "#384267",
            width: 1,
          },
          show: true,
        },
        splitLine: {
          show: false,
        },
        axisLine: {
          lineStyle: {
            color: "#384267",
            width: 1,
            type: "dashed",
          },
          show: true,
        },
        data: lnNm,
        type: "category",
      },
      yAxis: {
        nameTextStyle: {
          color: "#c0c3cd",
          padding: [0, 0, -10, 0],
          fontSize: 14,
        },
        axisLabel: {
          color: "#c0c3cd",
          fontSize: 14,
        },
        axisTick: {
          lineStyle: {
            color: "#384267",
            width: 1,
          },
          show: true,
        },
        splitLine: {
          show: true,
          lineStyle: {
            color: "#384267",
            type: "dashed",
          },
        },
        axisLine: {
          lineStyle: {
            color: "#384267",
            width: 1,
            type: "dashed",
          },
          show: true,
        },
        name: "",
      },
      series: [
        {
          data: lnHrMinDptrIntvl,
          type: "bar",
          barMaxWidth: "auto",
          barWidth: 20,
          itemStyle: {
            color: {
              x: 0,
              y: 0,
              x2: 0,
              y2: 1,
              type: "linear",
              global: false,
              colorStops: [
                {
                  offset: 0,
                  color: "#0b9eff",
                },
                {
                  offset: 1,
                  color: "#63caff",
                },
              ],
            },
          },
          label: {
            show: true,
            position: "top",
            distance: 10,
            color: "#fff",
          },
        },
        {
          data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
          type: "pictorialBar",
          barMaxWidth: "20",
          symbol: "diamond",
          symbolOffset: [0, "50%"],
          symbolSize: [20, 15],
        },
        {
          data: lnHrMinDptrIntvl,
          type: "pictorialBar",
          barMaxWidth: "20",
          symbolPosition: "end",
          symbol: "diamond",
          symbolOffset: [0, "-50%"],
          symbolSize: [20, 12],
          zlevel: 2,
        },
        {
          data: [
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
          ],
          type: "bar",
          barMaxWidth: "auto",
          barWidth: 20,
          barGap: "-100%",
          zlevel: -1,
        },
        {
          data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
          type: "pictorialBar",
          barMaxWidth: "20",
          symbol: "diamond",
          symbolOffset: [0, "50%"],
          symbolSize: [20, 15],
          zlevel: -2,
        },
        {
          data: [
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
            Math.max(lnHrMinDptrIntvl),
          ],
          type: "pictorialBar",
          barMaxWidth: "20",
          symbolPosition: "end",
          symbol: "diamond",
          symbolOffset: [0, "-50%"],
          symbolSize: [20, 12],
          zlevel: -1,
        },
      ],
      tooltip: {
        trigger: "axis",
        show: false,
      },
    };
    myChart.setOption(option);
  }
}
//正点率
punctualityRateEchart();
function punctualityRateEchart() {
  let punctualityRateE = document.getElementsByClassName(
    "punctualityRateEchart"
  );
  for (var i = 0; i < punctualityRateE.length; i++) {
    let myChart = echarts.init(punctualityRateE[i]);
    option = {
      textStyle: {
        color: "#b3babe",
      },
      legend: {
        type: "plain",
        top: 20,
        right: "2%",
        textStyle: {
          fontSize: 12,
        },
        itemGap: 40,
        itemWidth: 40,
        itemHeight: 20,
        data: [
          {
            name: "日累计",
            textStyle: {
              color: "#03dda3",
            },
          },
        ],
      },
      tooltip: {
        trigger: "axis",
        axisPointer: {
          type: "cross",
          axis: "x",
        },
        padding: [10, 10],
        extraCssText: "box-shadow: 1px 0 2px 0 rgba(163,163,163,0.5)",
      },
      grid: {
        top: "18%",
        left: "15%",
        right: "5%",
      },
      xAxis: {
        type: "category",
        boundaryGap: true,
        axisLabel: {
          fontSize: 12,
          margin: 20,
          color: "#85d7f9",
        },
        data: ["10.21", "10.22", "10.23", "10.24", "10.25", "10.26", "10.27"],
      },
      yAxis: {
        //name: "㎡/数量",
        scale: true,
        nameTextStyle: {
          fontSize: 25,
          color: "#3dcaff",
        },
        nameGap: 30,
        axisLine: true,
        axisLabel: {
          fontSize: 12,
          color: "#3dcaff",
        },
        splitLine: {
          show: true,
          lineStyle: {
            color: "#123144",
            width: 1,
          },
        },
      },
      series: [
        {
          name: "日累计",
          data: [0.9989, 0.9981, 0.9991, 0.9989, 0.9996, 0.9981, 0.9996],
          type: "line",
          showAllSymbol: true,
          smooth: true,
          label: {
            show: true,
            position: "top",
            textStyle: {
              color: "#00ca95",
              fontSize: 12,
            },
          },
          itemStyle: {
            normal: {
              color: "#3A84FF",
              lineStyle: {
                color: "#3A84FF",
                width: 1,
              },
              areaStyle: {
                color: {
                  type: "linear",
                  x: 0,
                  y: 1,
                  x2: 0,
                  y2: 0,
                  colorStops: [
                    {
                      offset: 0,
                      color: "rgba(0, 0, 0, 0)", // 0% 处的颜色
                    },
                    {
                      offset: 1,
                      color: "#1fb5fc", // 100% 处的颜色
                    },
                  ],
                },
              },
            },
          },
        },
      ],
    };
    myChart.setOption(option);
  }
}
// 车辆系统故障率
vehicleSystemFailureEchart();
function vehicleSystemFailureEchart() {
  let vehicleSystemFailureE = document.getElementsByClassName(
    "vehicleSystemFailureEchart"
  );
  for (var i = 0; i < vehicleSystemFailureE.length; i++) {
    let myChart = echarts.init(vehicleSystemFailureE[i]);
    var demoData = [
      {
        name: "5号线南延伸",
        value: 0,
      },
      {
        name: "9号线三期东延伸",
        value: 0,
      },
      {
        name: "13号线二、三期",
        value: 0.21,
      },
      {
        name: "17号线",
        value: 0,
      },
    ];
    option = {
      series: (function () {
        var result = [];
        demoData.forEach(function (item, index) {
          result.push(
            {
              name: item.name,
              type: "gauge",
              radius: "45.10%",
              center: [
                index < 2 ? index * 50 + 25 + "%" : index * 50 - 75 + "%",
                index < 2 ? "28%" : "78%",
              ],
              startAngle: 225,
              endAngle: -45,
              min: 0,
              max: 100,
              axisLine: {
                show: true,
                lineStyle: {
                  width: 10,
                  shadowBlur: 0,
                  color: [
                    [0, "transparent"],
                    [0.1, "#194383"],
                    [0.108, "transparent"],
                    [0.2, "#194383"],
                    [0.208, "transparent"],
                    [0.3, "#194383"],
                    [0.308, "transparent"],
                    [0.4, "#194383"],
                    [0.408, "transparent"],
                    [0.5, "#194383"],
                    [0.508, "transparent"],
                    [0.6, "#194383"],
                    [0.608, "transparent"],
                    [0.7, "#194383"],
                    [0.708, "transparent"],
                    [0.8, "#194383"],
                    [0.808, "transparent"],
                    [0.9, "#194383"],
                    [0.908, "transparent"],
                    [1, "#194383"],
                  ],
                },
              },
              axisTick: {
                show: false,
              },
              splitLine: {
                show: 0,
              },
              axisLabel: {
                show: 0,
              },
              pointer: {
                show: false,
              },
              detail: {
                show: false,
              },
              data: [
                {
                  show: false,
                },
              ],
            },
            {
              name: item.name,
              type: "gauge",
              radius: "48.1%",
              center: [
                index < 2 ? index * 50 + 25 + "%" : index * 50 - 75 + "%",
                index < 2 ? "28%" : "78%",
              ],
              startAngle: 225,
              endAngle: -45,
              min: 0,
              max: 100,
              axisLine: {
                show: true,
                lineStyle: {
                  width: 150,
                  color: [
                    [
                      item.value / 100,
                      new echarts.graphic.LinearGradient(0, 1, 0, 0, [
                        {
                          offset: 0,
                          color: "rgba(69, 161, 255,0)",
                        },
                        {
                          offset: 0.3,
                          color: "rgba(69, 161, 255,0)",
                        },
                        {
                          offset: 1,
                          color: "rgba(69, 161, 255,0.7)",
                        },
                      ]),
                    ],
                    [1, "rgba(28,128,245,.0)"],
                  ],
                },
              },
              axisTick: {
                show: false,
              },
              splitLine: {
                show: 0,
              },
              axisLabel: {
                show: 0,
              },
              pointer: {
                show: false,
                length: "100%",
              },
              detail: {
                show: true,
                offsetCenter: [1, "1%"],
                textStyle: {
                  fontSize: 20,
                  color: "#0AFCE0",
                },
                formatter: ["{value}"].join("\n"),
              },
              itemStyle: {
                color: "rgba(28, 128, 245,.3)",
                borderColor: "rgba(28, 128, 245,1)",
              },
              data: [
                {
                  value: item.value,
                },
              ],
            },
            {
              type: "gauge",
              radius: "35%",
              center: [
                index < 2 ? index * 50 + 25 + "%" : index * 50 - 75 + "%",
                index < 2 ? "28%" : "78%",
              ],
              splitNumber: 8,
              min: 0,
              max: 100,
              startAngle: 225,
              endAngle: -45,
              axisLabel: {
                show: false,
              },
              axisLine: {
                show: true,
                lineStyle: {
                  width: 0,
                  color: [
                    [
                      1,
                      new echarts.graphic.LinearGradient(0, 0, 1, 0, [
                        {
                          offset: 1,
                          color: "#194383",
                        },
                        {
                          offset: 1,
                          color: "#194383",
                        },
                      ]),
                    ],
                  ],
                },
              },

              splitLine: {
                show: true,
                length: 10,
                color: "#90D1FE",
              },
              pointer: {
                show: 0,
              },
              detail: {
                show: 0,
              },
            },
            {
              type: "gauge",
              radius: "50%",
              center: [
                index < 2 ? index * 50 + 25 + "%" : index * 50 - 75 + "%",
                index < 2 ? "28%" : "78%",
              ],
              // center: [
              //   index < 2 ? index * 39 + 20 + "%" : index * 45 - 40 + "%",
              //   index < 2 ? "30%" : "75%",
              // ],
              splitNumber: 10,
              splitLine: {
                show: false,
              },
              min: 0,
              max: 100,
              startAngle: 225,
              endAngle: -45,
              axisLabel: {
                show: false,
                textStyle: {
                  fontSize: 12,
                },
              },
              axisLine: {
                show: false,
              },

              pointer: {
                show: 0,
              },
              axisTick: {
                show: false,
              },
              detail: {
                show: true,
                offsetCenter: [0, "50%"],
                formatter: item.name,
                textStyle: {
                  fontSize: 12,
                  color: "#ffffff",
                  lineHeight: 20,
                  fontWeight: "100",
                },
              },
            },
            {
              type: "gauge",
              radius: "50%",
              center: [
                index < 2 ? index * 50 + 25 + "%" : index * 50 - 75 + "%",
                index < 2 ? "28%" : "78%",
              ],
              splitNumber: 10,
              splitLine: {
                show: false,
              },
              min: 0,
              max: 100,
              startAngle: 225,
              endAngle: -45,
              axisLabel: {
                show: false,
              },
              axisLine: {
                show: true,
                lineStyle: {
                  width: 2,
                  shadowBlur: 0,
                  color: [
                    [0.05, "#3F6BFC"],
                    [0.1, "#4072FB"],
                    [0.15, "#4077F9"],
                    [0.2, "#417BF9"],
                    [0.25, "#4282F8"],
                    [0.3, "#4385F7"],
                    [0.35, "#4389F6"],
                    [0.4, "#448FF5"],
                    [0.45, "#4594F4"],
                    [0.5, "#4599F3"],
                    [0.55, "#469EF2"],
                    [0.6, "#46A3F1"],
                    [0.65, "#46A6F0"],
                    [0.7, "#24befe"],
                    [0.75, "#12d1ff"],
                    [0.8, "#06defe"],
                    [0.85, "#05e0ff"],
                    [0.9, "#06deff"],
                    [0.95, "#06deff"],
                    [1, "#06deff"],
                  ],
                },
              },
              pointer: {
                show: 0,
              },
              axisTick: {
                show: false,
              },
              detail: {
                show: false,
              },
            },
            {
              type: "gauge",
              radius: "55%",
              center: [
                index < 2 ? index * 50 + 25 + "%" : index * 50 - 75 + "%",
                index < 2 ? "28%" : "78%",
              ],
              splitNumber: 10,
              splitLine: {
                show: false,
              },
              min: 0,
              max: 100,
              startAngle: 225,
              endAngle: -45,
              axisLabel: {
                show: false,
              },
              axisLine: {
                show: true,
                lineStyle: {
                  width: 2,
                  shadowBlur: 0,
                  color: [
                    [0.05, "#0A498E"],
                    [0.1, "#0C58A7"],
                    [0.15, "#254DD3"],
                    [0.2, "#355FEC"],
                    [0.25, "#4072FB"],
                    [0.3, "#355FEC"],
                    [0.35, "#254DD3"],
                    [0.4, "#06478B"],
                    [0.45, "#0A246C"],
                    [0.5, "#071848"],
                    [0.55, "#071848"],
                    [0.6, "#0A246C"],
                    [0.65, "#06478B"],
                    [0.7, "#254DD3"],
                    [0.75, "#355FEC"],
                    [0.8, "#355FEC"],
                    [0.85, "#254DD3"],
                    [0.9, "#0C58A7"],
                    [0.95, "#0A498E"],
                    [1, "#0A498E"],
                  ],
                },
              },
              pointer: {
                show: 0,
              },
              axisTick: {
                show: false,
              },
              detail: {
                show: false,
              },
            }
          );
        });

        return result;
      })(),
    };
    myChart.setOption(option);
  }
}
//信号系统故障率
signallingSystemEchart();
function signallingSystemEchart() {
  let signallingSystemE = document.getElementsByClassName(
    "signallingSystemEchart"
  );
  for (var i = 0; i < signallingSystemE.length; i++) {
    let myChart = echarts.init(signallingSystemE[i]);
    option = {
      grid: {
        top: "5%",
        right: "5%",
        left: "10%",
        bottom: "15%",
      },
      xAxis: [
        {
          type: "category",
          color: "#59588D",
          data: ["5号线南延伸", "9号线三期东延伸", "13号线二、三期", "17号线"],
          axisLabel: {
            margin: 20,
            color: "#fff",
            interval: 0,
            textStyle: {
              fontSize: 12,
            },
          },
          axisLine: {
            lineStyle: {
              color: "rgba(107,107,107,0.37)",
            },
          },
          axisTick: {
            show: false,
          },
        },
      ],
      yAxis: [
        {
          min: 0,
          max: 1,
          axisLabel: {
            formatter: "{value}",
            color: "#fff",
            textStyle: {
              fontSize: 12,
            },
          },
          axisLine: {
            lineStyle: {
              color: "rgba(107,107,107,0.37)",
            },
          },
          axisTick: {
            show: false,
          },
          splitLine: {
            lineStyle: {
              color: "rgba(131,101,101,0.2)",
              type: "dashed",
            },
          },
        },
      ],
      series: [
        {
          type: "bar",
          data: [0.23, 0.71, 0.06, 0.2],
          barWidth: "30px",
          itemStyle: {
            normal: {
              color: new echarts.graphic.LinearGradient(
                0,
                0,
                0,
                1,
                [
                  {
                    offset: 0,
                    color: "#FF9A22", // 0% 处的颜色
                  },
                  {
                    offset: 1,
                    color: "#FFD56E", // 100% 处的颜色
                  },
                ],
                false
              ),
              barBorderRadius: [30, 30, 0, 0],
            },
          },
          label: {
            normal: {
              show: true,
              fontSize: 12,
              fontWeight: "bold",
              color: "#fff",
              position: "top",
            },
          },
        },
      ],
    };
    myChart.setOption(option);
  }
}

//站台门故障率
platformDoorFailureEchart();
function platformDoorFailureEchart() {
  let platformDoorFailureE = document.getElementsByClassName(
    "platformDoorFailureEchart"
  );
  for (var i = 0; i < platformDoorFailureE.length; i++) {
    let myChart = echarts.init(platformDoorFailureE[i]);
    var color = new echarts.graphic.LinearGradient(0, 0, 1, 0, [
      {
        offset: 0,
        color: "#5CF9FE", // 0% 处的颜色
      },
      {
        offset: 0.17,
        color: "#468EFD", // 100% 处的颜色
      },
      {
        offset: 0.9,
        color: "#468EFD", // 100% 处的颜色
      },
      {
        offset: 1,
        color: "#5CF9FE", // 100% 处的颜色
      },
    ]);
    var rich = {
      white: {
        fontSize: 20,
        color: "#fff",
        fontWeight: "500",
        padding: [-40, 0, 0, 0],
      },
      bule: {
        fontSize: 20,
        fontFamily: "DINBold",
        color: "#fff",
        fontWeight: "700",
        padding: [-40, 0, 0, 0],
      },
      radius: {
        width: 100,
        height: 30,
        // lineHeight:80,
        borderWidth: 1,
        borderColor: "#0092F2",
        fontSize: 14,
        color: "#fff",
        backgroundColor: "#1B215B",
        borderRadius: 10,
        textAlign: "center",
      },
      size: {
        height: 10,
        padding: [140, 0, 0, 0],
      },
    };
    var fourPieData = [
      [
        {
          name: "5号线南延伸",
          value: 0.68,
        },
      ],
      [
        {
          name: "9号线三期东延伸",
          value: 0.22,
        },
      ],
      [
        {
          name: "13号线二、三期",
          value: 0.03,
        },
      ],
      [
        {
          name: "17号线",
          value: 0.25,
        },
      ],
    ];
    var titleArr = [],
      seriesArr = [];
    fourPieData.forEach(function (item, index) {
      titleArr.push({
        text: Object.values(item)[0].name,
        left: index < 2 ? index * 50 + 24 + "%" : index * 50 - 77 + "%",
        top: index < 2 ? "40%" : "90%",
        textAlign: "center",
        textStyle: {
          fontWeight: "normal",
          fontSize: "12",
          color: "#fff",
          textAlign: "center",
        },
      });
      seriesArr.push(
        {
          //内圆
          type: "pie",
          radius: "35%",
          // center: ["50%", "50%"],
          center: [
            index < 2 ? index * 50 + 25 + "%" : index * 50 - 75 + "%",
            index < 2 ? "25%" : "75%",
          ],
          z: 0,
          itemStyle: {
            normal: {
              color: new echarts.graphic.RadialGradient(
                0.5,
                0.5,
                1,
                [
                  {
                    offset: 0,
                    color: "rgba(17,24,43,0)",
                  },
                  {
                    offset: 0.5,
                    // color: '#1E2B57'
                    color: "rgba(28,42,91,.6)",
                  },
                  {
                    offset: 1,
                    color: "#141C33",
                    // color:'rgba(17,24,43,0)'
                  },
                ],
                false
              ),
              label: {
                show: false,
              },
              labelLine: {
                show: false,
              },
            },
          },
          hoverAnimation: false,
          label: {
            show: false,
          },
          tooltip: {
            show: false,
          },
          data: [100],
        },
        {
          type: "gauge",
          name: "外层辅助",
          radius: "40%",
          center: [
            index < 2 ? index * 50 + 25 + "%" : index * 50 - 75 + "%",
            index < 2 ? "25%" : "75%",
          ],
          startAngle: "225",
          endAngle: "-45",
          splitNumber: "100",
          pointer: {
            show: false,
          },
          detail: {
            show: false,
          },
          data: [
            {
              value: 1,
            },
          ],
          // data: [{value: 1, name: 90}],
          title: {
            show: true,
            offsetCenter: [0, 30],
            textStyle: {
              color: "#fff",
              fontStyle: "normal",
              fontWeight: "normal",
              fontFamily: "微软雅黑",
              fontSize: 20,
            },
          },
          axisLine: {
            show: true,
            lineStyle: {
              color: [[1, "#00FFFF"]],
              width: 2,
              opacity: 1,
            },
          },
          axisTick: {
            show: false,
          },
          splitLine: {
            show: true,
            length: 20,
            lineStyle: {
              color: "#051932",
              width: 0,
              type: "solid",
            },
          },
          axisLabel: {
            show: false,
          },
        },
        {
          type: "gauge",
          radius: "35%",
          center: [
            index < 2 ? index * 50 + 25 + "%" : index * 50 - 75 + "%",
            index < 2 ? "25%" : "75%",
          ],
          startAngle: "225",
          endAngle: "-45",
          pointer: {
            show: false,
          },
          detail: {
            formatter: function (value) {
              return "{bule|" + value + "}" + "{size|" + "}\n";
            },
            rich: rich,
            offsetCenter: ["0%", "0%"],
          },
          data: Object.values(item),
          title: {
            show: false,
          },
          axisLine: {
            show: true,
            lineStyle: {
              color: [
                [Object.values(item)[0].value, color],
                [1, "#15337C"],
              ],
              width: 10,
              // shadowBlur: 15,
              // shadowColor: '#B0C4DE',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              opacity: 1,
            },
          },
          axisTick: {
            show: false,
          },
          splitLine: {
            show: false,
            length: 25,
            lineStyle: {
              color: "#00377a",
              width: 2,
              type: "solid",
            },
          },
          axisLabel: {
            show: false,
          },
        },
        {
          name: "灰色内圈", //刻度背景
          type: "gauge",
          z: 2,
          radius: "26%",
          center: [
            index < 2 ? index * 50 + 25 + "%" : index * 50 - 75 + "%",
            index < 2 ? "25%" : "75%",
          ],
          startAngle: "225",
          endAngle: "-45",
          //center: ["50%", "75%"], //整体的位置设置
          axisLine: {
            // 坐标轴线
            lineStyle: {
              // 属性lineStyle控制线条样式
              color: [[1, "#018DFF"]],
              width: 2,
              opacity: 1, //刻度背景宽度
            },
          },
          splitLine: {
            show: false,
          },
          // data: [{
          //     show: false,
          //     value: '80'
          // }], //作用不清楚
          axisLabel: {
            show: false,
          },
          pointer: {
            show: false,
          },
          axisTick: {
            show: false,
          },
          detail: {
            show: 0,
          },
        },
        {
          name: "白色圈刻度",
          type: "gauge",
          radius: "26%",
          center: [
            index < 2 ? index * 50 + 25 + "%" : index * 50 - 75 + "%",
            index < 2 ? "25%" : "75%",
          ],
          startAngle: 225, //刻度起始
          endAngle: -45, //刻度结束
          z: 4,
          axisTick: {
            show: false,
          },
          splitLine: {
            length: 8, //刻度节点线长度
            lineStyle: {
              width: 2,
              color: "rgba(1,244,255, 0.9)",
            }, //刻度节点线
          },
          axisLabel: {
            color: "rgba(255,255,255,0)",
            fontSize: 12,
          }, //刻度节点文字颜色
          pointer: {
            show: false,
          },
          axisLine: {
            lineStyle: {
              opacity: 0,
            },
          },
          detail: {
            show: false,
          },
          data: [
            {
              value: 0,
              name: "",
            },
          ],
        },
        {
          //内圆
          type: "pie",
          radius: "28%",
          // center: ["50%", "50%"],
          center: [
            index < 2 ? index * 50 + 25 + "%" : index * 50 - 75 + "%",
            index < 2 ? "25%" : "75%",
          ],
          z: 1,
          itemStyle: {
            normal: {
              color: new echarts.graphic.RadialGradient(
                0.5,
                0.5,
                0.8,
                [
                  {
                    offset: 0,
                    color: "#4978EC",
                  },
                  {
                    offset: 0.5,
                    color: "#1E2B57",
                  },
                  {
                    offset: 1,
                    color: "#141F3D",
                  },
                ],
                false
              ),
              label: {
                show: false,
              },
              labelLine: {
                show: false,
              },
            },
          },
          hoverAnimation: false,
          label: {
            show: false,
          },
          tooltip: {
            show: false,
          },
          data: [100],
        }
      );
    });
    option = {
      backgroundColor: "#003366",
      title: titleArr,
      series: seriesArr,
    };
    myChart.setOption(option);
  }
}

// civilEngineeringCompletioRateEchart();
// function civilEngineeringCompletioRateEchart() {
//   let civilEngineeringCompletioRateE = document.getElementsByClassName(
//     "civilEngineeringCompletioRateEchart"
//   );
//   for (var i = 0; i < civilEngineeringCompletioRateE.length; i++) {
//     let myChart = echarts.init(civilEngineeringCompletioRateE[i]);
//     myChart.setOption(option);
//   }
// }
